
def sort_maopao(li):
    for i in range(len(li)-1):
        exchange = False
        for j in range(0,len(li)-1-i):
            if li[j] > li[j+1]:
                li[j],li[j+1] = li[j+1],li[j]
                exchange = True
        if not exchange:
            return
        # print(li)


li = [0,1,7,8,3,4,5,6]
print(li)
sort_maopao(li)
print(li)